import fetch from "@/utils/fetch";

// 说明：添加NB水表资料
// 接口：api/cb/flNbMeterInfo
// 请求类型：Post
export function addFlNbMeterInfo(obj) {
    return fetch({
        url: "api/cb/flNbMeterInfo",
        method: "post",
        data: obj,
    });
}

// 说明：删除NB水表资料
// 接口：api/cb/flNbMeterInfo/del
// 请求类型：Delete
export function deleteFlNbMeterInfo(idArr) {
    return fetch({
        url: "api/cb/flNbMeterInfo/del",
        method: "delete",
        data: idArr,
    });
}

// POST /flBook/search
// 手册管理 条件查询
export function flBooksearch() {
    return fetch({
        url: "api/cb/flBook/search",
        method: "post",
        // data: obj
    });
}

// POST /flBook/search
// 手册管理 条件查询

// 说明：修改NB水表资料
// 接口：api/cb/flNbMeterInfo/{id}
// 请求类型：Put
export function modifyFlNbMeterInfo(id, obj) {
    return fetch({
        url: "api/cb/flNbMeterInfo/" + id,
        method: "put",
        data: obj,
    });
}
//换表
export function changeTable(id, obj) {
    return fetch({
        url: "api/cb/flNbMeterInfo/changeTable" + id,
        method: "put",
        data: obj,
    });
}

// 说明：NB水表资料分页查询(条件搜索)
// 接口：api/cb/flNbMeterInfo/search/{page}/{size}
// 请求类型：Post
export function searchFlNbMeterInfo(page, size, obj) {
    return fetch({
        url: "api/cb/flNbMeterInfo/search/" + page + "/" + size,
        method: "post",
        data: obj,
    });
}

export function searchFlNbMeterInfoBS(page, size, obj) {
    return fetch({
        url: "api/cb/flNbMeterInfo/searchBS/" + page + "/" + size,
        method: "post",
        data: obj,
    });
}

// 说明：导出NBBSexprotXls
// 接口：api/cb/flNbMeterInfo/exprotXls
// 请求类型：get
export function NBBSexprotXls(idArr, obj) {
    return fetch({
        url: `api/cb/flNbMeterInfo/NBBSexprotXls/${idArr}`,
        method: "post",
        responseType: "blob",
        data: obj,
    });
}

// 远传表审核导出Excel /flWaterMeterInfo/findNbAndConEx/{ids}
export function auditexprotXls(idArr, obj) {
    return fetch({
        url: `api/cb/flWaterMeterInfo/findNbAndConEx/${idArr}`,
        method: "post",
        responseType: "blob",
        data: obj,
    });
}

// 说明：获取单个NB水表资料
// 接口：api/cb/flNbMeterInfo/{id}
// 请求类型：get
export function getFlNbMeterInfo(id) {
    return fetch({
        url: "api/cb/flNbMeterInfo/" + id,
        method: "get",
    });
}

// 说明：导出
// 接口：api/cb/flNbMeterInfo/exprotXls
// 请求类型：get
// export function exprotXls() {
//     return fetch({
//         url: 'api/cb/flNbMeterInfo/exprotXls',
//         responseType: 'blob',
//         method: 'get'
//     })
// }
// 说明：员工管理导出Excel数据
// 接口：api/product/flEmployeeManage/exprotXls/{ids}
// 请求类型：post
export function exprotXls(obj) {
    return fetch({
        url: `api/cb/flNbMeterInfo/exprotXls`,
        method: "post",
        responseType: "blob",
        data: obj,
    });
}
// export function exprotXls(idArr,obj) {
//     return fetch({
//         url: `api/cb/flNbMeterInfo/exprotXls/${idArr}`,
//         method: 'post',
//         responseType: 'blob',
//         data: obj
//     })
// }

// 说明：导入
// 接口：api/cb/flNbMeterInfo/importXls
// 请求类型：get
// export function importXls() {
//     return fetch({
//         url: 'api/cb/flNbMeterInfo/importXls',
//         method: 'get'
//     })
// }

// 说明：下载模板
// 接口：api/cb/flNbMeterInfo/exprotExcelModel
// 请求类型：get
export function downTem() {
    return fetch({
        url: "api/cb/flNbMeterInfo/exprotExcelModel",
        responseType: "blob",
        method: "get",
    });
}
// NB表审批
// PUT /flManualReading/ShenheNBUnselected
// NB表审核 审核未勾选的NB表
// 接口：/flManualReading/ShenheNBUnselected
// put
export function ShenheNBUnselected(arr) {
    return fetch({
        url: "api/cb/flManualReading/ShenheNBUnselected",
        method: "put",
        data: arr,
    });
}

// PUT /flManualReading/shenheNB
// NB表审核 审核勾选的NB表
export function shenheNB(arr) {
    return fetch({
        url: "api/cb/flManualReading/shenheNB",
        method: "put",
        data: arr,
    });
}
// POST /flNbAuditLog/search/{page}/{size}
// NB表审核记录 条件分页查询
// 查看 审批记录
export function flNbAuditLog(page, size, obj) {
    return fetch({
        url: `api/cb/flNbAuditLog/search/${page}/${size}`,
        method: "post",
        data: obj,
    });
}

// GET /flNbMeterInfo/syncIMEI
// 同步nb设备里的IMEI等信息到水表
export function syncIMEI() {
    return fetch({
        url: `api/cb/flNbMeterInfo/syncIMEI`,
        method: "get",
    });
}

// 说明：远传表（nb和集中器水表）资料分页查询(条件搜索)
// 接口：api/cb/flWaterMeterInfo/findNbAndCon/{page}/{size}
// 请求类型：Post
export function searchNbAndCon(page, size, obj) {
    return fetch({
        url: "api/cb/flWaterMeterInfo/findNbAndCon/" + page + "/" + size,
        method: "post",
        data: obj,
    });
}